home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6353 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.gate.net!news-adm
  2. From: "Mark W. Alexander" <mwa@gate.net>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What to do when feof() is NOT feof()
  5. Date: Fri, 23 Feb 1996 21:41:17 -0500
  6. Organization: CyberGate, Inc.
  7. Message-ID: <312E7ACD.60CF@gate.net>
  8. References: <4g7rsj$fnf@spectator.cris.com> <1996Feb19.063026.29889@zcon.com> <4gb7r3$p4k@sun001.spd.dsccc.com> <4gj6bg$mrv@solutions.solon.com>
  9. NNTP-Posting-Host: hopi.gate.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. Peter and Mike wrote stuff debating ethics, but I missed the technical details that started it 
  16. and have a problem that seems related to the subject...
  17.  
  18. I'm trying to monitor a log file while a process is running by piping tail -f into a C program 
  19. (Solaris 2.4, if it matters). Everything works wonderfull...until...I have a remote shell that 
  20. passes exception information to our trouble ticketing system so that the appriopriate (as in not 
  21. me!) people can be awakened at unpleasent hours. Shortly, (not immediately) after calling 
  22. system(remote_shell_command) the third or fourth time (abitrary as far as I can tell): feof() 
  23. becomes true, ferror() is false, and perror() says Interrupted system call (errno=4). In other 
  24. words:
  25.  
  26.     feof() != feof()
  27.  
  28. My humble question is: What the ???? I can't clear the error. I can't rewind(stdin). I can't exec 
  29. another copy to reinitialize everything. What can I do? 
  30.  
  31. For what it's worth, I also tried this in awk. awk simply stopped (again, a few lines) after the 
  32. system() command. In both cases commenting out the system() call prevents the problem. It seems 
  33. I'm missing something fundamental here with the pipe coming in and then passing out to another 
  34. shell. If I need a whack up side the head, please feel free. I'll take anything at this point!
  35.  
  36. TIA,
  37. Mark
  38.